﻿using System.Windows;
using System.Windows.Controls;

namespace FileRenamer
{
	/// <summary>
	/// Interaction logic for ExtensionManager.xaml
	/// </summary>
	public partial class ExtensionManager : Window
	{
		public ExtensionManager()
		{
			InitializeComponent();
		}

		private void Window_Loaded(object sender, RoutedEventArgs e)
		{
			this.Top = Globals.WindowLocation.X;
			this.Left = Globals.WindowLocation.Y;
			lstExtensions.DataContext = Globals.Commands;
		}

		private void lstExtensions_SelectionChanged(object sender, SelectionChangedEventArgs e)
		{
			lblName.DataContext = lstExtensions.SelectedItem;
			lblCommand.DataContext = lstExtensions.SelectedItem;
			lblDescription.DataContext = lstExtensions.SelectedItem;
			//chkEnable.IsChecked = !Globals.Settings.DisabledExtensions.Contains(lstExtensions.SelectedItem.GetType());
		}

		//private void chkEnable_Click(object sender, RoutedEventArgs e)
		//{
		//  if (chkEnable.IsChecked.Value)
		//    Globals.Settings.DisabledExtensions.Remove(lstExtensions.SelectedItem.GetType());
		//  else
		//    Globals.Settings.DisabledExtensions.Add(lstExtensions.SelectedItem.GetType());
		//}

		private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
		{
		}

	}

}
